package com.malware.detection;




import java.util.ArrayList;
import java.util.List;

import com.malware.detection.SystemBehaviour.LocalBinder;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;

import android.os.Bundle;
import android.os.IBinder;


import android.util.Log;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;


public class CopyOfDetectActivity extends Activity  {

/*
	SystemBehaviour myService;
	boolean isBound = false;
	List<String> listDuring=new ArrayList<String>();
	ArrayAdapter<String> adapterDuring;
	BroadcastReceiver serviceReceiver;

	//This is for binding to the service
	private ServiceConnection myConnection = new ServiceConnection() {

		public void onServiceConnected(ComponentName className,
				IBinder service) {
			LocalBinder binder = (LocalBinder) service;
			myService = binder.getService();
			isBound = true;

		}

		public void onServiceDisconnected(ComponentName arg0) {
			isBound = false;
		}

	};


	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		//POORNIMA!!!!
		//This is the place that you should update the lists and data on UI , This is a broadcast receiver which 
		// receives a broadcast from service when there is a change in data
		final IntentFilter theFilter = new IntentFilter();
		theFilter.addAction("malwareDetection.intent");
		this.serviceReceiver=new BroadcastReceiver() {

			//HERE PUT THE CODE FOR CHANGING THE LIST in this function
			// Use these function to get the result from service:
			// get_duringCall_result()    ==> this gives you a Array of strings . Just show this on the first list
			//get_afterCall_result()	==>this gives you a Array of strings . Just show this on the Second list
			//get_mem_duringcall()	==> show this single value somewhere
			//get_mem_aftercall()	==> show this single value somewhere
			@Override
			public void onReceive(Context context, Intent intent) {
				Log.d("malware detection activity", "Inside On Receive!!!");
				adapterDuring.clear();
				adapterDuring.addAll(myService.get_duringCall_result());
			}
		};
		this.registerReceiver(serviceReceiver,theFilter);


		setContentView(R.layout.activity_main);
		
	 		// Defining the listview object and ArrayAdapter
		ListView lvDuring=(ListView)findViewById(R.id.listDuring);
		adapterDuring=new ArrayAdapter<String>(this,
				R.id.listDuring,
				listDuring);
		lvDuring.setAdapter(adapterDuring);
 

		//Binding to  SystemBehavior
		Intent serviceIntent=new Intent(this,SystemBehaviour.class); 
		bindService(serviceIntent, myConnection, Context.BIND_AUTO_CREATE);


		//Defining Tabs
		TabHost tabHost=(TabHost)findViewById(R.id.tabHost);
		tabHost.setup();

		TabSpec spec1=tabHost.newTabSpec("Tab 1");
		spec1.setContent(R.id.tab1);
		spec1.setIndicator("During Call");

		TabSpec spec2=tabHost.newTabSpec("Tab 2");
		spec2.setIndicator("After Call");
		spec2.setContent(R.id.tab2);


		tabHost.addTab(spec1);
		tabHost.addTab(spec2);




	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

*/
}
